import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
import Layout from "@/layout";
import Goods from "@/views/goods";
import Login from '@/views/login'
const routes = [
	{
      path:'/login',
	  component:Login
	},
	{
		path: "/",
		redirect: "/home",
	},
	{
		path: "/home",
		component: Layout,
		redirect: "/home/goods",
		meta: { keepAlive: true },
		children: [
			{
				path: "/home/goods",
				component: Goods,
			},
			{
				path: "/home/comment",
				component: () => import("@/views/comment"),
			},
			{
				path: "/home/business",
				component: () => import("@/views/business"),
			},
		],
	},
	{
		path: "/details",
		name:'detail',
		meta: { keepAlive: false },
		component: () => import("@/views/details"),
	},
];

const router = new VueRouter({
	routes,
});

export default router;
